home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / amac34.arc / TOGL12.QM < prev    next >
Text File  |  1991-02-16  |  9KB  |  241 lines

  1. *                               TOGL12.QM
  2. *           Toggle Insert, AutoIndent and Backups Macros, v1.2
  3. *
  4. *      Macro --- Toggle ---  (1) Bytes   Keeps cursor position ?
  5. *       @5   Backups     Off TH   50     Yes                     <- new
  6. *       @6   Insert      Off TF   21     Yes
  7. *       @7   Insert      On  TF   21     Yes
  8. *       @8   Insert      On  KW   26     No, moves right
  9. *       @9   Insert      On  TH   16     No, moves right
  10. *       @0   AutoIndent  On  TH   46     No, begline
  11.  
  12. *
  13. *                                       (1) Authors: TH-Tom Hoghsead
  14. *                                                    KW-Kyle Watkins
  15. *                                                    TF-Tim Farley
  16. * Version History:
  17. *       1.0     Initial version, Alt9 & 0
  18. *       1.1     Alt_6,7 & 8 added
  19. *       1.1a    Changed file name TOGGLE11 to TOGL11.
  20. *       1.1b    Modified this file documentation.
  21. *       1.1c    Modified this file documentation and added START.BAT.
  22. *               Changed TOGGLE file names to TOGL.
  23. *       1.2     Added @5 toggle Backups OFF.
  24.  
  25. * For other macros, see ALLMACRO.INF.
  26.  
  27. * These macros require "QEdit and QMAC v2.1, February, 1990" or later.
  28. *
  29. * To BEGIN, just type "START TOGL" <Enter>. All pertinent files will be
  30. * loaded in the "Ring" for viewing, and TOGL12.MAC is read.
  31. * Alternatively, type "START TOGL 0" <Enter> and the disk copies of all
  32. * files in the "Ring" will be loaded ready for editing, saving time.
  33.  
  34.  
  35.  
  36.  
  37. *--------------------------------
  38. * @5 Toggle backups OFF if ON
  39. *--------------------------------
  40. * Change "c:" to ramdrive for faster operation.
  41. *
  42. @5  MacroBegin                          *
  43.     EditFile "c:!" Return               * Edit temp file
  44.     BegFile                             * TOF if temp file is loaded
  45.     MarkBlockBegin EndFile MarkBlockEnd * Mark file to delete all of it
  46.     DeleteBlock  Insertline             * Delete it! Make 2 line file
  47.     SaveFile SaveFile                   * Save twice to make backup if
  48.                                         * backups toggled ON
  49.     Killfile Quit                       * Kill/quit c:!
  50.     EditFile "c:!.bak" Return           * Load c:!.bak
  51.     Newfile Return                      * Exit and Edit c:!.bak
  52.     Gotoline "2" Return                 * Try to go to line 2
  53.     jfalse BAKOFF:                      * If line 2 not found, backups was OFF
  54.                                         * Test is false, go to BAKOFF
  55.                                         * ELSE backups was ON,
  56.     Togglebakups                        * and toggle backups OFF
  57.  BAKOFF:                                *
  58.     Killfile Quit                       * Kill/quit c:!.bak
  59. *
  60. * 50 bytes Tue  02-12-1991  12:14:46
  61.  
  62.  
  63.  
  64. *--------------------------------
  65. * @6 Toggle INSERT OFF
  66. *--------------------------------
  67. *
  68. @6 macrobegin
  69.         insertline           * insert test line
  70.         "a" cursorleft "a"   *
  71.         endline              * if not at endline-insert is on
  72.  jtrue WASON:                * if at endline    -insert is off
  73.         Jump WASOFF:
  74.  WASON:
  75.         toggleinsert         * toggle it off
  76.         cursorleft           * clean up cursor movement
  77.  WASOFF:
  78.         cursorleft           * clean up cursor movement
  79.         delline              * delete test line
  80. *
  81. * 21 bytes Mon  07-30-1990  19:16:01
  82.  
  83.  
  84.  
  85. *--------------------------------
  86. * @7 Toggle INSERT ON
  87. *--------------------------------
  88. *
  89. @7 macrobegin
  90.         insertline           * insert test line
  91.         "a" cursorleft "a"   *
  92.         endline              * if not at endline-insert is on
  93.  jtrue WASON:                * if at endline    -insert is off
  94.         toggleinsert         * toggle on it on
  95.         Jump WASOFF:         * and exit.
  96.  WASON:
  97.         cursorleft           * clean up cursor movement
  98.  WASOFF:
  99.         cursorleft           * clean up cursor movement
  100.         delline              * delete test line
  101. *
  102. * 21 bytes Mon  07-30-1990  19:15:36
  103.  
  104.  
  105.  
  106. *--------------------
  107. * @8 Toggle Insert ON
  108. *--------------------
  109. * Here's an alternate but slightly longer version written by Kyle
  110. * Watkins of SemWare
  111. *
  112. @8 Macrobegin
  113.         Insertline
  114.         "x"
  115.  TESTINSERT:
  116.         Insertline
  117.         Cursorleft "a" Cursorleft "a"
  118.  Endline
  119.  Jtrue END:
  120.         Toggleinsert
  121.  END:
  122.         Delline
  123.         Endline
  124.         Delline
  125. *
  126. * 26 bytes Fri  07-27-1990  22:44:48
  127.  
  128. *       Replace jtrue in Alt_9 line 3 and Alt_8 line 8 with jfalse
  129. *       to toggle off.
  130.  
  131. * To: TOM HOGSHEAD                  Refer#: 9159
  132. * From: KYLE WATKINS                    Read: 07-30-90 (18:35)
  133. * Subj: POSSIBLE QEDIT CHANGES        Status: PUBLIC MESSAGE
  134. * Conf: MAIN board (0)             Read Type: GENERAL (A)
  135. *
  136. * Hi Tom,
  137. *    The macro has some steps in it which seem unneccesary -- but it takes
  138. * care of the case of being in column 1  or  column 512  AND it will
  139. * preserve the original cursor location (since it is taking care of all
  140. * possibilities, it does get involved -- but in most cases, as in yours,
  141. * It can be cut back a few bytes.)
  142. *   Also -- many thanks for the assorted macros you have written -- many
  143. * users will find them very useful.
  144. *                              --... ...--
  145. * .......Kyle Watkins (SemWare Technical Support)
  146. *
  147. * (H)elp, End of Message Command?
  148. *
  149. * Date: 07-30-90 (17:34)              Number: 9191 / 9206
  150. *   To: TOM HOGSHEAD                  Refer#: 9159
  151. * From: TIM FARLEY                      Read: NO
  152. * Subj: POSSIBLE QEDIT CHANGES        Status: PUBLIC MESSAGE
  153. * Conf: MAIN board (0)             Read Type: GENERAL (A)
  154. *
  155. * TH>@0 macrobegin
  156. * TH>        insertline           * insert test line
  157. * TH>        "a" cursorleft "a"   *
  158. * TH>        endline              * if not at endline-insert is on
  159. * TH> jtrue END:                  * if at endline    -insert is off
  160. * TH>        toggleinsert         * toggle on if off
  161. * TH> END:                        *
  162. * TH>        delline              * delete test line
  163. *
  164. * Neat macro, Tom!  However, it does have a slight side effect of
  165. * moving the current cursor position to the right.  Here are
  166. * versions that make sure to undo that.
  167.  
  168.  
  169.  
  170. *---------------------
  171. * @9 toggles Insert ON
  172. *---------------------
  173. *
  174. @9 macrobegin
  175.         insertline                     * insert test line
  176.         "a" cursorleft "a"             * insert "aa"
  177.         endline                        * if not at endline-insert is on
  178.  jtrue END:                            * if at endline    -insert is off
  179.         toggleinsert                   * toggle on if off
  180.  END:                                  *
  181.         delline                        * delete test line
  182. *
  183. * 16 bytes Fri  07-27-1990  22:44:42
  184.  
  185.  
  186.  
  187.  
  188. *-------------------------
  189. *  @0 Toggle AutoIndent ON
  190. *-------------------------
  191. *
  192. * Alt_0 is a macro to toggle AutoIndent ON if OFF. I don't have any use
  193. * for it but maybe somebody does - I leave AutoIndent ON all the time.
  194. * Alt_9, a macro to toggle Insert ON if OFF, prompted me to see if
  195. * AutoIndent could also be toggled ON if OFF. No effort was spent
  196. * optimizing Alt_0. Somebody may want to try that. If anybody can use
  197. * it, use and enjoy. There no tricks here, just taking advantage of
  198. * jtrue. By the way, AutoIndent can be toggled OFF if ON by replacing
  199. * jtrue with jfalse. Don't run with cursor line in macro below or the
  200. * ■'s in the comments will be found and things get messed up.
  201. *
  202. @0 macrobegin
  203.         setrmargin "3" return           * set line 3 chars
  204.         insertline                      * insertblank line for bot para
  205.         begline                         * go to begin of line
  206.         cursorright                     * insert space
  207.         insertline                      * insert 2nd blank line
  208.         #254                            * insert ■ on line in column 2
  209.         insertline                      * insert 3rd blank line
  210.         begline                         * go to begin of line
  211.         #254 #254                       * insert ■■ in column 1 & 2
  212.         insertline                      * insert blank line for top para
  213.         wrappara                        * format paragraph
  214.         setrmargin  "80" return         * reset right margin
  215.         cursorup                        * get cursor line on bot para
  216.         begline                         * go to begline
  217.         find #254 return return         * try to find ■
  218.  jtrue INDENTON:                        * if ■ in column 1, can't find
  219.         toggleindent                    * toggle AutoIndent ON
  220.  INDENTON:                              * begin clean up
  221.         delline                         * delete line ■
  222.         cursorup                        * cursor up to line ■■
  223.         delline                         * delete       line ■■
  224.         cursorup                        * cursor up to blank line
  225.         delline                         * delete blank line
  226.         delline                         * delete blank line
  227.         scrollup                        * reallign screen
  228. *
  229. * 46 bytes Sat  07-28-1990  18:33:31
  230.  
  231. * 1  
  232. * 2
  233. * 3  try Alt_0 here not above
  234. * 4
  235. * 5
  236. * 6
  237.  
  238.  
  239.  
  240. *...Tom Hogshead    Tue  02-12-1991
  241.